// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

pub mod company_service {
    use crate::Result;

    /// A builder for [CompanyService][crate::client::CompanyService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_talent_v4::*;
    /// # use builder::company_service::ClientBuilder;
    /// # use client::CompanyService;
    /// let builder : ClientBuilder = CompanyService::builder();
    /// let client = builder
    ///     .with_endpoint("https://jobs.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::CompanyService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = CompanyService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::CompanyService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::CompanyService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::CompanyService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [CompanyService::create_company][crate::client::CompanyService::create_company] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::company_service::CreateCompany;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateCompany {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateCompany(RequestBuilder<crate::model::CreateCompanyRequest>);

    impl CreateCompany {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::CompanyService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateCompanyRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Company> {
            (*self.0.stub)
                .create_company(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateCompanyRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [company][crate::model::CreateCompanyRequest::company].
        ///
        /// This is a **required** field for requests.
        pub fn set_company<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Company>,
        {
            self.0.request.company = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [company][crate::model::CreateCompanyRequest::company].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_company<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Company>,
        {
            self.0.request.company = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateCompany {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [CompanyService::get_company][crate::client::CompanyService::get_company] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::company_service::GetCompany;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetCompany {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetCompany(RequestBuilder<crate::model::GetCompanyRequest>);

    impl GetCompany {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::CompanyService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetCompanyRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Company> {
            (*self.0.stub)
                .get_company(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetCompanyRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetCompany {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [CompanyService::update_company][crate::client::CompanyService::update_company] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::company_service::UpdateCompany;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateCompany {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateCompany(RequestBuilder<crate::model::UpdateCompanyRequest>);

    impl UpdateCompany {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::CompanyService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateCompanyRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Company> {
            (*self.0.stub)
                .update_company(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [company][crate::model::UpdateCompanyRequest::company].
        ///
        /// This is a **required** field for requests.
        pub fn set_company<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Company>,
        {
            self.0.request.company = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [company][crate::model::UpdateCompanyRequest::company].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_company<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Company>,
        {
            self.0.request.company = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateCompanyRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateCompanyRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateCompany {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [CompanyService::delete_company][crate::client::CompanyService::delete_company] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::company_service::DeleteCompany;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteCompany {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteCompany(RequestBuilder<crate::model::DeleteCompanyRequest>);

    impl DeleteCompany {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::CompanyService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteCompanyRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_company(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteCompanyRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteCompany {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [CompanyService::list_companies][crate::client::CompanyService::list_companies] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::company_service::ListCompanies;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListCompanies {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListCompanies(RequestBuilder<crate::model::ListCompaniesRequest>);

    impl ListCompanies {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::CompanyService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListCompaniesRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListCompaniesResponse> {
            (*self.0.stub)
                .list_companies(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListCompaniesResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListCompaniesResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListCompaniesRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListCompaniesRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListCompaniesRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [require_open_jobs][crate::model::ListCompaniesRequest::require_open_jobs].
        pub fn set_require_open_jobs<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.require_open_jobs = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListCompanies {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [CompanyService::get_operation][crate::client::CompanyService::get_operation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::company_service::GetOperation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetOperation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);

    impl GetOperation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::CompanyService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .get_operation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetOperation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod completion {
    use crate::Result;

    /// A builder for [Completion][crate::client::Completion].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_talent_v4::*;
    /// # use builder::completion::ClientBuilder;
    /// # use client::Completion;
    /// let builder : ClientBuilder = Completion::builder();
    /// let client = builder
    ///     .with_endpoint("https://jobs.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::Completion;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = Completion;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::Completion] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::Completion>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::Completion>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [Completion::complete_query][crate::client::Completion::complete_query] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::completion::CompleteQuery;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CompleteQuery {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CompleteQuery(RequestBuilder<crate::model::CompleteQueryRequest>);

    impl CompleteQuery {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::Completion>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CompleteQueryRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::CompleteQueryResponse> {
            (*self.0.stub)
                .complete_query(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [tenant][crate::model::CompleteQueryRequest::tenant].
        ///
        /// This is a **required** field for requests.
        pub fn set_tenant<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.tenant = v.into();
            self
        }

        /// Sets the value of [query][crate::model::CompleteQueryRequest::query].
        ///
        /// This is a **required** field for requests.
        pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.query = v.into();
            self
        }

        /// Sets the value of [language_codes][crate::model::CompleteQueryRequest::language_codes].
        pub fn set_language_codes<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.language_codes = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [page_size][crate::model::CompleteQueryRequest::page_size].
        ///
        /// This is a **required** field for requests.
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [company][crate::model::CompleteQueryRequest::company].
        pub fn set_company<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.company = v.into();
            self
        }

        /// Sets the value of [scope][crate::model::CompleteQueryRequest::scope].
        pub fn set_scope<T: Into<crate::model::complete_query_request::CompletionScope>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.scope = v.into();
            self
        }

        /// Sets the value of [r#type][crate::model::CompleteQueryRequest::type].
        pub fn set_type<T: Into<crate::model::complete_query_request::CompletionType>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.r#type = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CompleteQuery {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Completion::get_operation][crate::client::Completion::get_operation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::completion::GetOperation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetOperation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);

    impl GetOperation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::Completion>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .get_operation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetOperation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod event_service {
    use crate::Result;

    /// A builder for [EventService][crate::client::EventService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_talent_v4::*;
    /// # use builder::event_service::ClientBuilder;
    /// # use client::EventService;
    /// let builder : ClientBuilder = EventService::builder();
    /// let client = builder
    ///     .with_endpoint("https://jobs.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::EventService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = EventService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::EventService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::EventService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::EventService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [EventService::create_client_event][crate::client::EventService::create_client_event] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::event_service::CreateClientEvent;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateClientEvent {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateClientEvent(RequestBuilder<crate::model::CreateClientEventRequest>);

    impl CreateClientEvent {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::EventService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateClientEventRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ClientEvent> {
            (*self.0.stub)
                .create_client_event(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateClientEventRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [client_event][crate::model::CreateClientEventRequest::client_event].
        ///
        /// This is a **required** field for requests.
        pub fn set_client_event<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::ClientEvent>,
        {
            self.0.request.client_event = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [client_event][crate::model::CreateClientEventRequest::client_event].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_client_event<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::ClientEvent>,
        {
            self.0.request.client_event = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateClientEvent {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [EventService::get_operation][crate::client::EventService::get_operation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::event_service::GetOperation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetOperation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);

    impl GetOperation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::EventService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .get_operation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetOperation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod job_service {
    use crate::Result;

    /// A builder for [JobService][crate::client::JobService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_talent_v4::*;
    /// # use builder::job_service::ClientBuilder;
    /// # use client::JobService;
    /// let builder : ClientBuilder = JobService::builder();
    /// let client = builder
    ///     .with_endpoint("https://jobs.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::JobService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = JobService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::JobService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [JobService::create_job][crate::client::JobService::create_job] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::job_service::CreateJob;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateJob {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateJob(RequestBuilder<crate::model::CreateJobRequest>);

    impl CreateJob {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateJobRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Job> {
            (*self.0.stub)
                .create_job(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateJobRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [job][crate::model::CreateJobRequest::job].
        ///
        /// This is a **required** field for requests.
        pub fn set_job<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Job>,
        {
            self.0.request.job = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [job][crate::model::CreateJobRequest::job].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Job>,
        {
            self.0.request.job = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateJob {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [JobService::batch_create_jobs][crate::client::JobService::batch_create_jobs] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::job_service::BatchCreateJobs;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> BatchCreateJobs {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct BatchCreateJobs(RequestBuilder<crate::model::BatchCreateJobsRequest>);

    impl BatchCreateJobs {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::BatchCreateJobsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [batch_create_jobs][crate::client::JobService::batch_create_jobs].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .batch_create_jobs(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `batch_create_jobs`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<crate::model::BatchCreateJobsResponse, crate::model::BatchOperationMetadata>
        {
            type Operation = lro::internal::Operation<
                crate::model::BatchCreateJobsResponse,
                crate::model::BatchOperationMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::BatchCreateJobsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [jobs][crate::model::BatchCreateJobsRequest::jobs].
        ///
        /// This is a **required** field for requests.
        pub fn set_jobs<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::Job>,
        {
            use std::iter::Iterator;
            self.0.request.jobs = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for BatchCreateJobs {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [JobService::get_job][crate::client::JobService::get_job] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::job_service::GetJob;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetJob {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);

    impl GetJob {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Job> {
            (*self.0.stub)
                .get_job(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetJobRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetJob {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [JobService::update_job][crate::client::JobService::update_job] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::job_service::UpdateJob;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateJob {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateJob(RequestBuilder<crate::model::UpdateJobRequest>);

    impl UpdateJob {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateJobRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Job> {
            (*self.0.stub)
                .update_job(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [job][crate::model::UpdateJobRequest::job].
        ///
        /// This is a **required** field for requests.
        pub fn set_job<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Job>,
        {
            self.0.request.job = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [job][crate::model::UpdateJobRequest::job].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Job>,
        {
            self.0.request.job = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateJobRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateJobRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateJob {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [JobService::batch_update_jobs][crate::client::JobService::batch_update_jobs] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::job_service::BatchUpdateJobs;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> BatchUpdateJobs {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct BatchUpdateJobs(RequestBuilder<crate::model::BatchUpdateJobsRequest>);

    impl BatchUpdateJobs {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::BatchUpdateJobsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [batch_update_jobs][crate::client::JobService::batch_update_jobs].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .batch_update_jobs(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `batch_update_jobs`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<crate::model::BatchUpdateJobsResponse, crate::model::BatchOperationMetadata>
        {
            type Operation = lro::internal::Operation<
                crate::model::BatchUpdateJobsResponse,
                crate::model::BatchOperationMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::BatchUpdateJobsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [jobs][crate::model::BatchUpdateJobsRequest::jobs].
        ///
        /// This is a **required** field for requests.
        pub fn set_jobs<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::Job>,
        {
            use std::iter::Iterator;
            self.0.request.jobs = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [update_mask][crate::model::BatchUpdateJobsRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateJobsRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for BatchUpdateJobs {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [JobService::delete_job][crate::client::JobService::delete_job] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::job_service::DeleteJob;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteJob {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteJob(RequestBuilder<crate::model::DeleteJobRequest>);

    impl DeleteJob {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteJobRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_job(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteJobRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteJob {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [JobService::batch_delete_jobs][crate::client::JobService::batch_delete_jobs] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::job_service::BatchDeleteJobs;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> BatchDeleteJobs {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct BatchDeleteJobs(RequestBuilder<crate::model::BatchDeleteJobsRequest>);

    impl BatchDeleteJobs {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::BatchDeleteJobsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [batch_delete_jobs][crate::client::JobService::batch_delete_jobs].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .batch_delete_jobs(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `batch_delete_jobs`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<crate::model::BatchDeleteJobsResponse, crate::model::BatchOperationMetadata>
        {
            type Operation = lro::internal::Operation<
                crate::model::BatchDeleteJobsResponse,
                crate::model::BatchOperationMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::BatchDeleteJobsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [names][crate::model::BatchDeleteJobsRequest::names].
        pub fn set_names<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.names = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for BatchDeleteJobs {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [JobService::list_jobs][crate::client::JobService::list_jobs] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::job_service::ListJobs;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListJobs {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);

    impl ListJobs {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
            (*self.0.stub)
                .list_jobs(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListJobsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListJobsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListJobsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::ListJobsRequest::filter].
        ///
        /// This is a **required** field for requests.
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [job_view][crate::model::ListJobsRequest::job_view].
        pub fn set_job_view<T: Into<crate::model::JobView>>(mut self, v: T) -> Self {
            self.0.request.job_view = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListJobs {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [JobService::search_jobs][crate::client::JobService::search_jobs] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::job_service::SearchJobs;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> SearchJobs {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct SearchJobs(RequestBuilder<crate::model::SearchJobsRequest>);

    impl SearchJobs {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SearchJobsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SearchJobsResponse> {
            (*self.0.stub)
                .search_jobs(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::SearchJobsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [search_mode][crate::model::SearchJobsRequest::search_mode].
        pub fn set_search_mode<T: Into<crate::model::search_jobs_request::SearchMode>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.search_mode = v.into();
            self
        }

        /// Sets the value of [request_metadata][crate::model::SearchJobsRequest::request_metadata].
        ///
        /// This is a **required** field for requests.
        pub fn set_request_metadata<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::RequestMetadata>,
        {
            self.0.request.request_metadata = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [request_metadata][crate::model::SearchJobsRequest::request_metadata].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_request_metadata<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::RequestMetadata>,
        {
            self.0.request.request_metadata = v.map(|x| x.into());
            self
        }

        /// Sets the value of [job_query][crate::model::SearchJobsRequest::job_query].
        pub fn set_job_query<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::JobQuery>,
        {
            self.0.request.job_query = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [job_query][crate::model::SearchJobsRequest::job_query].
        pub fn set_or_clear_job_query<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::JobQuery>,
        {
            self.0.request.job_query = v.map(|x| x.into());
            self
        }

        /// Sets the value of [enable_broadening][crate::model::SearchJobsRequest::enable_broadening].
        pub fn set_enable_broadening<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.enable_broadening = v.into();
            self
        }

        /// Sets the value of [histogram_queries][crate::model::SearchJobsRequest::histogram_queries].
        pub fn set_histogram_queries<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::HistogramQuery>,
        {
            use std::iter::Iterator;
            self.0.request.histogram_queries = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [job_view][crate::model::SearchJobsRequest::job_view].
        pub fn set_job_view<T: Into<crate::model::JobView>>(mut self, v: T) -> Self {
            self.0.request.job_view = v.into();
            self
        }

        /// Sets the value of [offset][crate::model::SearchJobsRequest::offset].
        pub fn set_offset<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.offset = v.into();
            self
        }

        /// Sets the value of [max_page_size][crate::model::SearchJobsRequest::max_page_size].
        pub fn set_max_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.max_page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::SearchJobsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [order_by][crate::model::SearchJobsRequest::order_by].
        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.order_by = v.into();
            self
        }

        /// Sets the value of [diversification_level][crate::model::SearchJobsRequest::diversification_level].
        pub fn set_diversification_level<
            T: Into<crate::model::search_jobs_request::DiversificationLevel>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.diversification_level = v.into();
            self
        }

        /// Sets the value of [custom_ranking_info][crate::model::SearchJobsRequest::custom_ranking_info].
        pub fn set_custom_ranking_info<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::search_jobs_request::CustomRankingInfo>,
        {
            self.0.request.custom_ranking_info = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [custom_ranking_info][crate::model::SearchJobsRequest::custom_ranking_info].
        pub fn set_or_clear_custom_ranking_info<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::search_jobs_request::CustomRankingInfo>,
        {
            self.0.request.custom_ranking_info = v.map(|x| x.into());
            self
        }

        /// Sets the value of [disable_keyword_match][crate::model::SearchJobsRequest::disable_keyword_match].
        #[deprecated]
        pub fn set_disable_keyword_match<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.disable_keyword_match = v.into();
            self
        }

        /// Sets the value of [keyword_match_mode][crate::model::SearchJobsRequest::keyword_match_mode].
        pub fn set_keyword_match_mode<
            T: Into<crate::model::search_jobs_request::KeywordMatchMode>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.keyword_match_mode = v.into();
            self
        }

        /// Sets the value of [relevance_threshold][crate::model::SearchJobsRequest::relevance_threshold].
        pub fn set_relevance_threshold<
            T: Into<crate::model::search_jobs_request::RelevanceThreshold>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.relevance_threshold = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for SearchJobs {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [JobService::search_jobs_for_alert][crate::client::JobService::search_jobs_for_alert] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::job_service::SearchJobsForAlert;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> SearchJobsForAlert {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct SearchJobsForAlert(RequestBuilder<crate::model::SearchJobsRequest>);

    impl SearchJobsForAlert {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SearchJobsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SearchJobsResponse> {
            (*self.0.stub)
                .search_jobs_for_alert(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::SearchJobsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [search_mode][crate::model::SearchJobsRequest::search_mode].
        pub fn set_search_mode<T: Into<crate::model::search_jobs_request::SearchMode>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.search_mode = v.into();
            self
        }

        /// Sets the value of [request_metadata][crate::model::SearchJobsRequest::request_metadata].
        ///
        /// This is a **required** field for requests.
        pub fn set_request_metadata<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::RequestMetadata>,
        {
            self.0.request.request_metadata = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [request_metadata][crate::model::SearchJobsRequest::request_metadata].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_request_metadata<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::RequestMetadata>,
        {
            self.0.request.request_metadata = v.map(|x| x.into());
            self
        }

        /// Sets the value of [job_query][crate::model::SearchJobsRequest::job_query].
        pub fn set_job_query<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::JobQuery>,
        {
            self.0.request.job_query = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [job_query][crate::model::SearchJobsRequest::job_query].
        pub fn set_or_clear_job_query<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::JobQuery>,
        {
            self.0.request.job_query = v.map(|x| x.into());
            self
        }

        /// Sets the value of [enable_broadening][crate::model::SearchJobsRequest::enable_broadening].
        pub fn set_enable_broadening<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.enable_broadening = v.into();
            self
        }

        /// Sets the value of [histogram_queries][crate::model::SearchJobsRequest::histogram_queries].
        pub fn set_histogram_queries<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::HistogramQuery>,
        {
            use std::iter::Iterator;
            self.0.request.histogram_queries = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [job_view][crate::model::SearchJobsRequest::job_view].
        pub fn set_job_view<T: Into<crate::model::JobView>>(mut self, v: T) -> Self {
            self.0.request.job_view = v.into();
            self
        }

        /// Sets the value of [offset][crate::model::SearchJobsRequest::offset].
        pub fn set_offset<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.offset = v.into();
            self
        }

        /// Sets the value of [max_page_size][crate::model::SearchJobsRequest::max_page_size].
        pub fn set_max_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.max_page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::SearchJobsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [order_by][crate::model::SearchJobsRequest::order_by].
        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.order_by = v.into();
            self
        }

        /// Sets the value of [diversification_level][crate::model::SearchJobsRequest::diversification_level].
        pub fn set_diversification_level<
            T: Into<crate::model::search_jobs_request::DiversificationLevel>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.diversification_level = v.into();
            self
        }

        /// Sets the value of [custom_ranking_info][crate::model::SearchJobsRequest::custom_ranking_info].
        pub fn set_custom_ranking_info<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::search_jobs_request::CustomRankingInfo>,
        {
            self.0.request.custom_ranking_info = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [custom_ranking_info][crate::model::SearchJobsRequest::custom_ranking_info].
        pub fn set_or_clear_custom_ranking_info<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::search_jobs_request::CustomRankingInfo>,
        {
            self.0.request.custom_ranking_info = v.map(|x| x.into());
            self
        }

        /// Sets the value of [disable_keyword_match][crate::model::SearchJobsRequest::disable_keyword_match].
        #[deprecated]
        pub fn set_disable_keyword_match<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.disable_keyword_match = v.into();
            self
        }

        /// Sets the value of [keyword_match_mode][crate::model::SearchJobsRequest::keyword_match_mode].
        pub fn set_keyword_match_mode<
            T: Into<crate::model::search_jobs_request::KeywordMatchMode>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.keyword_match_mode = v.into();
            self
        }

        /// Sets the value of [relevance_threshold][crate::model::SearchJobsRequest::relevance_threshold].
        pub fn set_relevance_threshold<
            T: Into<crate::model::search_jobs_request::RelevanceThreshold>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.relevance_threshold = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for SearchJobsForAlert {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [JobService::get_operation][crate::client::JobService::get_operation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::job_service::GetOperation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetOperation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);

    impl GetOperation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::JobService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .get_operation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetOperation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod tenant_service {
    use crate::Result;

    /// A builder for [TenantService][crate::client::TenantService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_talent_v4::*;
    /// # use builder::tenant_service::ClientBuilder;
    /// # use client::TenantService;
    /// let builder : ClientBuilder = TenantService::builder();
    /// let client = builder
    ///     .with_endpoint("https://jobs.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::TenantService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = TenantService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::TenantService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::TenantService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::TenantService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [TenantService::create_tenant][crate::client::TenantService::create_tenant] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::tenant_service::CreateTenant;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateTenant {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateTenant(RequestBuilder<crate::model::CreateTenantRequest>);

    impl CreateTenant {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::TenantService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateTenantRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Tenant> {
            (*self.0.stub)
                .create_tenant(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateTenantRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [tenant][crate::model::CreateTenantRequest::tenant].
        ///
        /// This is a **required** field for requests.
        pub fn set_tenant<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Tenant>,
        {
            self.0.request.tenant = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [tenant][crate::model::CreateTenantRequest::tenant].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_tenant<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Tenant>,
        {
            self.0.request.tenant = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateTenant {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [TenantService::get_tenant][crate::client::TenantService::get_tenant] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::tenant_service::GetTenant;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetTenant {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetTenant(RequestBuilder<crate::model::GetTenantRequest>);

    impl GetTenant {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::TenantService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetTenantRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Tenant> {
            (*self.0.stub)
                .get_tenant(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetTenantRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetTenant {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [TenantService::update_tenant][crate::client::TenantService::update_tenant] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::tenant_service::UpdateTenant;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateTenant {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateTenant(RequestBuilder<crate::model::UpdateTenantRequest>);

    impl UpdateTenant {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::TenantService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateTenantRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Tenant> {
            (*self.0.stub)
                .update_tenant(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [tenant][crate::model::UpdateTenantRequest::tenant].
        ///
        /// This is a **required** field for requests.
        pub fn set_tenant<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Tenant>,
        {
            self.0.request.tenant = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [tenant][crate::model::UpdateTenantRequest::tenant].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_tenant<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Tenant>,
        {
            self.0.request.tenant = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateTenantRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateTenantRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateTenant {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [TenantService::delete_tenant][crate::client::TenantService::delete_tenant] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::tenant_service::DeleteTenant;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteTenant {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteTenant(RequestBuilder<crate::model::DeleteTenantRequest>);

    impl DeleteTenant {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::TenantService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteTenantRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_tenant(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteTenantRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteTenant {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [TenantService::list_tenants][crate::client::TenantService::list_tenants] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::tenant_service::ListTenants;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListTenants {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListTenants(RequestBuilder<crate::model::ListTenantsRequest>);

    impl ListTenants {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::TenantService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListTenantsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListTenantsResponse> {
            (*self.0.stub)
                .list_tenants(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListTenantsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListTenantsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListTenantsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListTenantsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListTenantsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListTenants {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [TenantService::get_operation][crate::client::TenantService::get_operation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_talent_v4::builder;
    /// use builder::tenant_service::GetOperation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetOperation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);

    impl GetOperation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::TenantService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .get_operation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetOperation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}
